<template>
	<div class="wrap">
	<xcl-header :show="loading.show" :call-back="()=>{}" :page-title="pageTitle" :header-right="headerRight"></xcl-header>
	<div class="content">
		<div class="card" style="margin-top:0">
	      	<ul>
	      		<li class="row descrip-item">
	      			<div class="col-25">产品全称</div>
	      			<div class="col-75">{{productInfo.n}}</div>
	      		</li>
	      		<li class="row descrip-item">
	      			<div class="col-25">产品状态</div>
	      			<div class="col-75">{{productInfo.s | getProductStatus}}</div>
	      		</li>
	      		<li class="row descrip-item">
	      			<div class="col-25">产品类型</div>
	      			<div class="col-75">{{productInfo.t | getProductType}}</div>
	      		</li>
	      		<li class="row descrip-item">
	      			<div class="col-25">初始规模</div>
	      			<div class="col-75">{{productInfo.itf/10000}}万元</div>
	      		</li>
	      		<li class="row descrip-item">
	      			<div class="col-25">名额限制</div>
	      			<div class="col-75">{{productInfo.r}}人</div>
	      		</li>
	      		<li class="row descrip-item" style="border:0">
	      			<div class="col-25">投资范围</div>
	      			<div class="col-75">{{productRisk.nvestment}}</div>
	      		</li>
	      	</ul>
		</div>
		<div class="card" style="margin-top:0">
	      	<ul>
	      		<li class="row descrip-item">
	      			<div class="col-25">成立日</div>
	      			<div class="col-75">{{productInfo.ed | getLastTimeStr}}</div>
	      		</li>
	      		<li class="row descrip-item">
	      			<div class="col-25">存续期</div>
	      			<div class="col-75">{{productInfo.dd/30}}个月</div>
	      		</li>
	      		<li class="row descrip-item">
	      			<div class="col-25">封闭期</div>
	      			<div class="col-75">{{productInfo.cb | getLastTimeStr}}~{{productInfo.ce | getLastTimeStr}}，封闭期内不办理购买、赎回等业务</div>
	      		</li>
	      		<li class="row descrip-item" style="border:0">
	      			<div class="col-25">开放日</div>
	      			<div class="col-75">{{productInfo.ob==productInfo.oe ? openDay[productInfo.oi]+productInfo.ob+'日':openDay[productInfo.oi]+productInfo.ob+'日~'+productInfo.oe+'日'}}</div>
	      		</li>
	      	</ul>
		</div>
		<div class="card" style="margin-top:0">
	      	<ul>
	      		<li class="row descrip-item">
	      			<div class="col-25">策略团队</div>
	      			<div class="col-75">{{teamInfo.n}}</div>
	      		</li>
	      		<li class="row descrip-item">
	      			<div class="col-25">投资经理</div>
	      			<div class="col-75">{{managerInfo.n}}</div>
	      		</li>
	      		<li class="row descrip-item">
	      			<div class="col-25">监管机构</div>
	      			<div class="col-75">{{regulator[productExtend.cbrc]}}</div>
	      		</li>
	      		<li class="row descrip-item">
	      			<div class="col-25">托管银行</div>
	      			<div class="col-75">{{productExtend.bank}}</div>
	      		</li>
	      		<li class="row descrip-item">
	      			<div class="col-25">证券经纪人</div>
	      			<div class="col-75">{{productExtend.brokers}}</div>
	      		</li>
	      		<li class="row descrip-item">
	      			<div class="col-25">是否结构化</div>
	      			<div class="col-75">{{IsStruct[productInfo.is]}}</div>
	      		</li>
	      		<li class="row descrip-item" style="border:0">
	      			<div class="col-25">备案号码</div>
	      			<div class="col-75">{{productExtend.record}}</div>
	      		</li>
	      	</ul>
		</div>
	</div>
	</div>
</template>
<script>
	import xclHeader from '../components/header.vue'
	let ProductProxy =  require("../proxy/product_proxy");
	let InvestTeamProxy =  require("../proxy/invest_team_proxy");
	let product = new ProductProxy();
	let team = new InvestTeamProxy();
	export default {
		data(){
			return{
				pageTitle:'产品要素',
				productSId: this.$route.params.SId,
				teamId:this.$route.params.tid,
				managerId:this.$route.params.mid,
				regulator:['中国银行业监督管理委员会','中国证券监督管理委员会','中国保险监督管理委员会'],
				IsStruct:['是','否'],
				openDay:['-','每月','双月','每季','半年','每年','产品结束'],
				productInfo:{},
				teamInfo:{},
				managerInfo:{},
				productRisk:{},
				productExtend:{},
				loading:{
                    show:false,
                    showTxt:'数据加载中...'
                }
			}
		},
		ready(){
			this.getProductElement();
		},
		methods:{
			getProductElement(){
				var _this=this;
				product.getProduct(_this.productSId,function(data){
					if(data.code === 200 && data.results && data.results.length){
						_this.productInfo=data.results[0];
					}
				});
				product.getProductRiskControlMap(_this.productSId,function(data){
					if(data.code === 200 && data.results){
						_this.productRisk=data.results[0];
					}
				});
				product.getProductExtendMap(_this.productSId,function(data){
					if(data.code === 200 && data.results){
						_this.productExtend=data.results[0];
					}
				});
				team.getTeamById(_this.teamId,function(data){
					if(data.code === 200 && data.results && data.results.length){
						_this.teamInfo=data.results[0];
					}
				});
				team.getInverstManager(_this.managerId,function(data){
					if(data.code === 200 && data.results && data.results.length){
						_this.managerInfo=data.results[0];
					}
				});
			}
		},
		components:{
           "xclHeader":xclHeader,          
        }
	}
</script>
<style lang="stylus">
ul{
	margin:0;
	padding:0;
	list-style: none;
}
.descrip-item{
	padding: 0.5rem 0;
	margin:0 0.3rem;
  	border-bottom: 1px solid #dadada;
}
</style>